/*
 * @Author: your name
 * @Date: 2022-04-29 20:27:15
 * @LastEditTime: 2022-04-30 22:48:35
 * @LastEditors: Please set LastEditors
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \nuxt-demo\plugins\i18n.ts
 */
// eslint-disable-next-line import/namespace
import Vue from 'vue'
import VueI18n from 'vue-i18n'
import { Context } from '@nuxt/types'
Vue.use(VueI18n)
export default ({ app }: Context) => {
  // Set i18n instance on app
  // This way we can use it in middleware and pages asyncData/fetch

  app.i18n = new VueI18n({
    locale: 'en',
    messages: {
      en: require('../locales/en-US.json'),
      cn: require('../locales/zh-CN.json'),
    },
  })
}